package com.test.ll;

public class Count3Quit1 {
	public static void main(String[] args){
		boolean[] ary= new boolean[500];
		for(int i=0;i<ary.length;i++){
			ary[i]=false;
		}
		
		int length=ary.length;
		int count=0;
		int index=0;
		
		while(length>1){
			if(ary[index]==false){
			count++;
			if(count==3){
				count=0;
				ary[index]=true;
				length--;
			}
			}
			index++;
			
			if(index==ary.length){
				index=0;
			}
			
		}
		for(int i=0;i<ary.length;i++){
			if(ary[i]==false){
				System.out.println(i);
			}
		}
	}

}
